import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import page from './router.config'

const routes = [
	// 基础路由
	{
		path: '/',
		redirect: '/report'
	},
	{
		path: '/:pathMatch(.*)*',
		redirect: '/404'
	},
	{
		name: 'admin',
		path: '/admin',
		component: () => import('../views/layout'),
		children:page,
	},
	{
		path: '/login',
		name: 'login',
		component: () => import('../views/Login'),
		title:'商户管理登录',
	},
]

const router = createRouter({
	history: createWebHashHistory(process.env.BASE_URL),
	routes
})

export default router
